<?php
include "class.phpmailer.php";
include "class.smtp.php";
class Zend_Sendmail_Send{
	//include "class.phpmailer.php"; 
	//include "class.smtp.php"; 
	public function sendmail($username, $password,$fromname,$to,$name,$subject,$body,$from,$namereply){
		$mail = new PHPMailer();
		$mail->CharSet = "utf-8";
		$mail->IsSMTP(); // set mailer to use SMTP
		$mail->Host = "smtp.gmail.com"; // specify main and backup server
		$mail->Port = 465; // set the port to use
		$mail->SMTPAuth = true; // turn on SMTP authentication
		$mail->SMTPSecure = 'ssl';						
		$mail->Username = $username;//"linhvuit@gmail.com"; // your SMTP username or your gmail username
		$mail->Password = $password;//"linhnvfpt090"; // your SMTP password or your gmail password
		//$from = "info@sinhviendongthap.net"; // Reply to this email
		//$to="linhvuit@ymail.com"; // Recipients email ID
		//$name="Ngo Vu Linh"; // Recipient's name
		//$mail->From = $from;
		$mail->FromName = $fromname;//"Linh Vu Ngo"; // Name to indicate where the email came from when the recepient received
		$mail->AddAddress($to,$name);
		$mail->AddReplyTo($from,$namereply);
		$mail->WordWrap = 50; // set word wrap
		$mail->IsHTML(true); // send as HTML
		$mail->Subject = $subject;//"Test mail script from bloghoctap.com";
		$mail->Body = $body;//"<b>Mail nay duoc goi bang phpmailer class. - <a href='http://bloghoctap.com'>bloghoctap.com</a></b>"; //HTML Body
		//$mail->AltBody = "Mail nay duoc goi bang phpmailer class. - bloghoctap.com"; //Text Body
		//$mail->SMTPDebug = 2;
		if(!$mail->Send())
		{
			return false;//echo "<h1>Loi khi goi mail: " . $mail->ErrorInfo . '</h1>';
		}
		else
		{
			return true;//echo "<h1>Send mail thanh cong</h1>";
		}
		
	}
}


?>